package jp.co.redfox.archclub.poker.player;

import jp.co.redfox.archclub.poker.Deck;
import jp.co.redfox.archclub.poker.Game;
import jp.co.redfox.archclub.poker.Hand;
import jp.co.redfox.archclub.poker.HandOverFlowException;
import jp.co.redfox.archclub.poker.Player;

public abstract class AbstractPlayer implements Player {

    protected final Hand hand = new Hand();
    
    @Override
    public void draw() throws HandOverFlowException {
        draw(1);
    }

    @Override
    public void draw(int drawNumbers) throws HandOverFlowException {
        Deck deck = Game.getCurrentGame().getDeck();
        for (int countNumbers = 0; countNumbers < drawNumbers; countNumbers++) 
            hand.add(deck.dealCard());


    }
    
    
    @Override
    public void dropAll(){
        hand.clear();
    }

}
